hvm: fix XSAVE leaf 0 EBX size calculation
authorKeir Fraser <keir@xen.org>
Sun, 6 Feb 2011 17:26:31 +0000 (17:26 +0000)
committerKeir Fraser <keir@xen.org>
Sun, 6 Feb 2011 17:26:31 +0000 (17:26 +0000)
commitb6f72ecd9eae09e31970f051d9921a70f9e36e84
tree12968993ea44bf8a6985f2841985c79eefae00cb
parent20a91fe64a70d77c1331b11512ec889c0eea1130
hvm: fix XSAVE leaf 0 EBX size calculation

Fixes a size calculation bug when enabled bits in XFEATURE_MASK (xcr0)
aren't contiguous.

Current for_loop will stop when xcr0 feature bit is 0. But in reality,
the bits can be non-contiguous. One example is that LWP is bit 62 on
AMD platform. This patch iterates through all bits to calculate the
size for enabled features.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen/arch/x86/hvm/hvm.c